package com.coocaa.ops.admin.v1.dmp.tag.service.impl;

import com.coocaa.ops.admin.v1.dmp.entity.SysUserDisableTagRlsEntity;
import com.coocaa.ops.admin.v1.dmp.tag.convert.TagSaveBeanConverter;
import com.coocaa.ops.admin.v1.dmp.tag.model.TagSaveModel;
import com.coocaa.ops.admin.v1.dmp.tag.provider.impl.DmpTagSaveProviderImpl;
import com.coocaa.ops.admin.v1.dmp.tag.service.IDmpTagSaveService;
import com.coocaa.ops.common.core.biz.auth.entity.SysUserEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author bijiahao
 * @description
 * @date 2020/6/23 14:59
 */
@Service
public class DmpTagSaveServiceImpl implements IDmpTagSaveService{
    @Autowired
    private DmpTagSaveProviderImpl tagSaveProvider;

    @Override
    public void saveDisableTag(TagSaveModel tagSaveModel, SysUserEntity user) {
        List<SysUserDisableTagRlsEntity> disableTagRlsEntityList = TagSaveBeanConverter.getSaveDisableTagList(tagSaveModel, user.getId());
        tagSaveProvider.saveDisableTag(disableTagRlsEntityList, tagSaveModel.getRoleId());
    }
}
